<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="lib/vue.js"></script>
</head>
<body>
  <div id="root">
    <my-title :title="title" class="abc"></my-title>
  </div>
</body>
<script>
  const myTitle = {
    // vue2.0 注意 inheritAttrs: false 选项不会影响 style 和 class 的绑定。
    // inheritAttrs: false,
    // props: ['title'],
    template: `
      <div>
        <h1>hello - {{ title }}</h1>
        <h2>hello - {{ title }}</h2>
      </div>
    `
  }
  new Vue({
    el: '#root',
    data: {
      title: '标题'
    },
    components: {
      myTitle
    }
  })
</script>
</html>